﻿
Imports osi.root.connector
Imports osi.service.argument

Public Class gzip
    Implements zipper

    'do not support any parameters for now, so the gzip instance can be shared
    Private Shared ReadOnly instance As gzip

    Shared Sub New()
        instance = New gzip()
    End Sub

    Private Sub New()
    End Sub

    Public Shared Function create(ByVal v As var, ByRef o As zipper) As Boolean
        o = instance
        Return True
    End Function

    Public Function unzip(ByVal i() As Byte, ByRef o() As Byte) As Boolean Implements zipper.unzip
        Return _compress.ungzip(i, o)
    End Function

    Public Function zip(ByVal i() As Byte, ByRef o() As Byte) As Boolean Implements zipper.zip
        Return _compress.gzip(i, o)
    End Function
End Class
